[.NET] What's the point of MarshalByValue Object?

Posted by smwikipedia on Stack Overflow See other posts from Stack Overflow or by smwikipedia
Published on 2010-05-24T06:58:08Z Indexed on 2010/05/24 7:01 UTC
Read the original article Hit count: 185

Filed under:
|
|

Hi awesome!

We know that MarshalByRef allow us to create an object in a different AppDomain and use a Proxy object to access it. And the behavior of that object is in a different context of the AppDomain where it actually lives in. Well this sounds faily reseaonable in the regard of isolation and safety.

But why is there still MarshalByValue? MarshalByValue just leads to an newly deserialized object which is an exact copy of the object in a different AppDomain. If we need that object, why not just create it in the current AppDomain? Why bother to first create it in a different AppDomain and then get it back by MarshaoByValue?

Many thanks.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET